package com.ad_hccm.dao.GeneralInformation;

import com.ad_hccm.domain.GeneralInformation.Drink;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * TODO 饮酒Dao
 */
@Mapper
public interface DrinkDao {
    @Insert("insert into drink value(#{id}, #{volumeDaily}, #{year})")
    public boolean save(Drink drink);

    @Update("update drink set volumeDaily = #{volumeDaily}, year = #{year} where id=#{id}")
    public boolean update(Drink drink);

    @Select("select * from drink where id=#{id}")
    public Drink getById(String id);

    @Select("select * from drink")
    public List<Drink> getAll();
}
